﻿#include <iostream>
#include <assert.h>
#include "paramtermgr.h"


void test()
{
	GET_PARAM("System", "LogLevel", 1000); 
	GET_PARAM("System", "Delay", 5);
}

void test2()
{
	GET_PARAM("System", "Cycle", 15);
}

class A{

public:
    void test()
    {
        auto num = GET_PARAM("System", "threadNum", 15); 		
		auto dl = GET_PARAM("System", "Delay", 5);
		std::cout << "threadNum:" << num << "   Delay:" << dl << std::endl;

		auto msg = GET_PARAM("System", "INFO", "Message");
		std::cout << "INFO:" << msg << std::endl;
    }
};


int main()
{
    std::cout << "开始" << std::endl;
	
	ParamContainerBase::Initialize();

	std::map<std::string, std::map<std::string, std::string>> cfg;
	cfg["System"]["threadNum"] = "2";
	cfg["System"]["Delay"] = "12";
	CAppConfigAgent::get_instance().AddConfigItem(cfg);

	CParamterMgr::get_instance().Dump();

   	A().test();
    return 0;
}